package org.person.gift.clients;

import org.person.gift.clients.fallback.GiftClientFallback;
import org.person.gift.util.AjaxResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.Map;
import java.util.Set;

/**
 * @Auther Stark
 * @Date 2024/02/20
 */
@FeignClient(value = "gift-gift",fallback = GiftClientFallback.class)
public interface GiftClient {

    @GetMapping("/goodsSku/{id}")
    AjaxResult get(@PathVariable("id")Long id);

    @PostMapping("/goodsSku/ids")
    AjaxResult getSkusByIds(@RequestBody Set<Long> ids);

    @PostMapping("/goodsSku/release/lockstock")
    AjaxResult releaseLockStock(@RequestBody Map<Long,Integer> skuInfos);
}
